<template>
	<uni-forms class="van-form" ref="dynamicFormRef" >
		<slot></slot>
	</uni-forms>
</template>

<script setup>
import {ref, watch} from 'vue';
const dynamicFormRef = ref(null)

const validate = ()=>{
	 dynamicFormRef.value.validate((valid, errors) => {
		 console.log({
			 errors,
			 valid
		 })
	    if (valid) {
	      console.log("整体校验通过");
	    } else {
	      console.log("校验失败", errors);
	    }
	  });
 return  dynamicFormRef.value.validate()
}
const resetValidation = ()=>{
  dynamicFormRef.value.clearValidate()
}
defineExpose({
	validate
})
</script>

<style lang="scss" scoped>
</style>